package com.edfu.core.coursemgt.persistence.entity;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

import com.edfu.core.commons.persistence.entity.CategoryEntity;
@Entity
@Table(name="courseoffering_category", uniqueConstraints=@UniqueConstraint(columnNames={"category_id" , "courseoffering_id"}))
public class CourseOfferingCategoryRelnEntity implements ICourseMgtEntity {
	private long id;
	private CourseOfferingEntity courseOffering;
	private CategoryEntity category;
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	
	@ManyToOne
	@JoinColumn(name = "courseoffering_id", nullable = false)
	public CourseOfferingEntity getCourseOffering() {
		return courseOffering;
	}
	public void setCourseOffering(CourseOfferingEntity courseOffering) {
		this.courseOffering = courseOffering;
	}
	
	@ManyToOne
	@JoinColumn(name = "category_id", nullable = false)
	public CategoryEntity getCategory() {
		return category;
	}
	public void setCategory(CategoryEntity category) {
		this.category = category;
	}
	
	
	
}
